n = input()

s = [int(i) for i in input().split()]

print("{}\n{}\n{}".format(max(s),min(s),sum(s)))
